const lark = require("@larksuiteoapi/node-sdk");
var axios = require("axios");

//更改对应的app_id
const FEISHU_APP_ID = "cli_a5353776bba9100d";
const FEISHU_APP_SECRET = "nSNp3X7T6NWgP7kkY3Rt9dGJpfjBbPcR";


const client = new lark.Client({
    appId: FEISHU_APP_ID,
    appSecret: FEISHU_APP_SECRET,
    disableTokenCache: false,
    appType: lark.AppType.SelfBuild,
    domain: lark.Domain.Feishu,
});


async function executeAsyncFunction001() {
    try {
        const result = await client.im.message.createByCard({
            params: {
                receive_id_type: "chat_id"
            },
            data: {
                receive_id: "oc_bdd7369c17da5c75d01537975d021d65",
                template_id: 'ctp_AAiWZwt1wsse'
            }
        }, {});
        console.log(result); // 输出 'Hello World'
    } catch (error) {
        console.error(error);
    }
}


executeAsyncFunction001()
